Skip to content

feat: v2.2.0 — function-level blast radius, ReindexStale, BatchFileStatus, QueryAbiHash, Tier 1.5 inference, Tier 2 backoff#23

Closed
SimplyLiz wants to merge 7 commits intomainfrom
develop
Closed

feat: v2.2.0 — function-level blast radius, ReindexStale, BatchFileStatus, QueryAbiHash, Tier 1.5 inference, Tier 2 backoff#23
SimplyLiz wants to merge 7 commits intomainfrom
develop

Conversation

@SimplyLiz
Copy link
Copy Markdown
Contributor

Summary

  • NearestItem.embedding_model — per-hit model provenance on all nearest-neighbour results; backward-compatible (#[serde(default, skip_serializing_if)])
  • Function-level blast radiusblast_radius_batch uses per-symbol embeddings when available; SemanticImpactItem.symbol_uri now non-empty at function granularity, falls back to file-level
  • ReindexStale — atomic check-then-reindex in one message (uris, max_age_seconds); replaces the QueryFileStatusReindexFiles race
  • BatchFileStatus — multi-file status in one round-trip, batchable
  • QueryAbiHash — SHA-256 over exported symbol surface; stable recompilation trigger (batchable, Kotlin IC model)
  • Tier 1.5 Datalog inferencerun_tier1_5_inference() fixed-point loop: callee elevation when all callers ≥ 80 confidence; exported-leaf +5 bump; ceiling 65
  • Tier 2 backoff recovery — all 8 LSP backends recover from crashes with exponential backoff (2–300 s); permanent disable only after 8 consecutive failures
  • Version bump to 2.2.0 across workspace + tools

Test plan

  • 313 unit tests green
  • 14 integration tests green
  • clippy -D warnings clean
  • cargo fmt --check clean
  • supported_messages_covers_all_variants drift guard passes (3 new tags: reindex_stale, batch_file_status, query_abi_hash)
  • CI passes on ubuntu + macos
  • Tag lip-core-2.2.0 + publish to crates.io (after explicit approval)

🤖 Generated with Claude Code

SimplyLiz and others added 7 commits April 16, 2026 09:12
… and embeddings

The SCIP import path pushed pre-computed symbols/occurrences/edges via
Delta but the daemon silently dropped them in multiple places:

- Journal wrote empty text → symbols lost on daemon restart
- upsert_file_precomputed ignored CPG edges → blast-radius broken
- stale_files hashed empty text → infinite Merkle re-sync loop
- file_source_text returned "" → embeddings, stream_context, and
  explain-match all failed for imported files

Fix: FileInput now carries a precomputed flag and content_hash.
JournalEntry::UpsertFilePrecomputed persists symbols, occurrences,
and edges so they survive compact + replay. stale_files uses the
stored content_hash. file_source_text falls back to disk for
precomputed file:// URIs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- session.rs: explain why Tier 2 verification is skipped for pre-computed
  SCIP imports (source_opt is None by design, SCIP emitters are
  authoritative)
- export.rs: document that SCIP round-trips lose CPG edges since the
  SCIP wire format has no edge representation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on, CI workflow

Five improvements in one batch:

1. SCIP integration test — end-to-end test proving pre-computed symbols
   from Delta are searchable via WorkspaceSymbols and resolvable via
   QueryDefinition (regression coverage for the import path fix)

2. Proto fix — Relationship.is_override → is_definition to match
   upstream SCIP field 5 semantics; export mapping updated accordingly

3. SCIP CI action — reusable GitHub Actions workflow
   (.github/workflows/scip-import.yml) that runs a SCIP indexer
   (rust/typescript/python), starts a LIP daemon, and pushes the
   index at confidence 100

4. Tier 2 test harness — 14 unit tests for the verification manager:
   routing dispatch, channel backpressure, confidence elevation,
   symbol upgrade merging, backend unavailability

5. Name-dep invalidation — new invalidated_files_for() query answering
   "which files break if these symbols change" using the existing
   file_consumed_names index; wired into the daemon protocol as
   QueryInvalidatedFiles / InvalidatedFilesResult

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New protocol message that computes blast radius for all symbols defined
in the given changed files in one call. When min_score is present,
each file's embedding is compared against the index and neighbours
above the threshold are returned as semantic_items with a source tier
(static / semantic / both).

Designed for CKB's BlastRadiusEnricher: one round-trip prefetch in
reviewPR, static callers stay authoritative for thresholds, semantic
callers are advisory with per-item confidence.

Wire format:
  → query_blast_radius_batch { changed_file_uris, min_score? }
  ← blast_radius_batch_result { results: [EnrichedBlastRadius] }

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…changelog

- LIP_SPEC.mdx §8.1.1: batch blast radius with semantic enrichment,
  symbol kind filtering rationale, embedding scope note (file-level
  today, per-function when chunked embeddings land)
- daemon.mdx: add QueryBlastRadiusBatch to protocol message table
- CHANGELOG.md: document all unreleased changes (SCIP fixes, journal
  persistence, name-dep invalidation, blast radius batch)
- db.rs: filter blast_radius_batch to Function/Method/Class/Interface/
  Constructor/Macro kinds; add embedding scope comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…yAbiHash, Tier1.5, backoff

Tier 1:
- NearestItem.embedding_model: per-hit model provenance on all nearest-neighbour results
- blast_radius_batch: symbol-level semantic enrichment when symbol_embeddings available;
  SemanticImpactItem.symbol_uri now non-empty at function granularity, falls back to file-level
- ReindexStale { uris, max_age_seconds } → ReindexStaleResult { reindexed, skipped }:
  atomic check-then-reindex replacing the QueryFileStatus → ReindexFiles race

Tier 2:
- BatchFileStatus { uris } → BatchFileStatusResult { entries: Vec<FileStatusEntry> }:
  multi-file status in one round-trip, batchable
- Tier 2 backoff recovery: all 8 LSP backends recover from crashes with exponential backoff
  (2–300s); permanently disabled only after 8 consecutive failures (BackoffState struct)

Tier 3:
- QueryAbiHash { uri } → AbiHashResult { uri, hash }: SHA-256 over exported symbol surface,
  stable recompilation trigger (batchable); Kotlin IC-style ABI fingerprinting
- LipDatabase::run_tier1_5_inference(): Datalog fixed-point loop — callee elevation when all
  callers ≥ 80 confidence, exported-leaf +5 bump; ceiling 65 (Tier 1.5 level)

All new variants wired into variant_tag, supported_messages, is_batchable, and the
BatchQuery sync handler. 313 unit tests + 14 integration tests green, clippy clean, fmt clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SimplyLiz SimplyLiz closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant